package tbs.framework.boardcast.notify.impl;

import tbs.framework.boardcast.notify.INotifying;
import tbs.framework.boardcast.subject.ISubject;

/**
 * 简单的广播实现
 *
 * @author tongj
 */
public class SimpleNotifying<T> implements INotifying<T> {

    public static final Integer CREATE = 1, UPDATE = 2, DELETE = 3;

    public static final Integer PASS = 1, FAIL = 2, IDLE = 3;

    private Integer type, status;

    private ISubject subject;

    private T data;

    public SimpleNotifying(Integer type, Integer status, ISubject subject, T data) {
        this.type = type;
        this.status = status;
        this.subject = subject;
        this.data = data;
    }

    public SimpleNotifying() {
    }

    @Override
    public Integer getType() {
        return type;
    }

    @Override
    public ISubject getSubject() {
        return subject;
    }

    @Override
    public Integer getStatus() {
        return status;
    }

    @Override
    public INotifying<T> setStatus(Integer status) {
        this.status = status;
        return this;
    }

    @Override
    public T getData() {
        return data;
    }
}
